package org.touch.server;

import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.Map;


public class ClientsManager {
	
	private Map<SocketChannel, ClientBean> clientMap = new HashMap<SocketChannel, ClientBean>();
	
	private static ClientsManager manager = null;
	
	private ClientsManager(){
		
	}
	
	public static ClientsManager getInstance(){
		if(manager == null){
			manager = new ClientsManager();
		}
		return manager;
	}

	public void remove(SocketChannel sc){
		clientMap.remove(sc);
	}
	
	public ClientBean getClientBean(SocketChannel sc){
		return clientMap.get(sc);
	}
	
	public void addClientBean(SocketChannel sc){
		clientMap.put(sc, new ClientBean());
	}
}
